<?php
require_once('auth_admin.php');
?>

<!DOCTYPE html>
<html>
    <link type="text/css" rel="stylesheet" href="giftgiving.css"/>
    <!-- Uncomment the line below to include javascript in your webpage -->
    <!--<script type="text/javascript" src="giftgiving.js"/>-->
    <style type="text/css">
<!--
.STYLE1 {
	font-size: 18px;
	font-weight: bold;
}
.STYLE2 {font-size: 16px}
.STYLE3 {font-size: 18px}
-->
    </style>
    <head>
        <title>Flora Home Admin</title>
    </head>
    <body>
        <div id="gift-view-id">
			<!-------- Side Bars -------------------------------------------------------------------------->
            <div id="gift-navpane-id" class="gift-navpane">
    			<div id="gift-pets-id" class="gift-types">
                    <a href="cus_home.php" class="STYLE1">Customer Home</a>				</div>
                <div id="gift-pets-id" class="gift-types gift-types-selected">
                    <a href="admin_home.php" class="STYLE1">Admin Home</a>		    </div>
                    
                    <div id="gift-register-id" class="gift-types">
                    <a href="admin_reg.php" class="STYLE1">Admin Register</a>    			</div>
                <div id="gift-register-id" class="gift-types">
                    <a href="admin_Profile.php" class="STYLE1">Admin Profile</a> 	    </div>
				
				<div id="gift-register-id" class="gift-types">
				    <a href="admin_order.php" class="STYLE1">Order Info</a>             </div>
				<div id="gift-register-id" class="gift-types">
				    <a href="admin_customer.php" class="STYLE1">Customer Info</a>             </div>
				<div id="gift-register-id" class="gift-types">
				    <a href="Admin_flower.php" class="STYLE1">Flower Info</a>             </div>
					<div id="gift-register-id" class="gift-types">
				    <a href="FlowersInput.php" class="STYLE1">Add Flower</a>             </div>
                    <div id="gift-register-id" class="gift-types">
				    <a href="admin_login.php" class="STYLE1">Logout</a>             </div>
    		</div>
    		<div id="gift-choosepane-id" class="gift-choosepane">
               <!-- Note the onClick handler for this element -->
               <div id="gift-table" >
        	   <table>
        			  <th colspan="3"><span class="STYLE2">Choose your Bouquet</span></th>
					  <tr> <form action="admin_flower.php" method="post">
					      <td>
                          category:</td><td><input type="text" name="category" /></td><td>
						  occasion:</td><td> 
						  <select name="occasion">
						  <option value=""></option>
                          <option value="valentine">valentine</option>
                          <option value="birthday">birthday</option>
						  <option value="grand opening">grand opening</option>
						  <option value="mother day">mother day</option>
                          <option value="wedding">wedding</option></select>
						  </td><td>
						  color:</td><td><input type="text" name="color" /></td><td>
						  
						  size:</td><td>
						  <select name="size">
						  <option value=""></option>
                          <option value="L">L</option>
                          <option value="M">M</option>
                          <option value="S">S</option></select></td><td>
						  price:</td><td>
						  <select name="price">
						  <option value=""></option>
                          <option value="20"><=$20</option>
                          <option value="50"><=$50</option>
                          <option value="100"><=$100</option>
						  <option value="500"><=$500</option></select>
						  </td><td>
						  <input type="submit" value="Submit">
                          </td>
						  </form> 						  
                     </tr>	
        			<tr>
                     <?php
$con=mysql_connect("localhost","root","123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("cs2102_db", $con);

					$result = mysql_query("SELECT * FROM Flowers");
                      echo "<tr>	
    <td></td>				          
    <td>name</td>
	<td>category</td>
	<td>occasion</td>
	<td>color</td>
	<td>size</td>
	<td>price</td>
	<td>quantity</td>
	</tr>";
	while ($row = mysql_fetch_array($result)){					
		echo "<tr>";
		echo "<td> <img id='Socks' src='".$row['picture']."'/></td>";
		echo "<td>" . $row['fname'] . "</td>";
		echo "<td>" . $row['category'] . "</td>";
		echo "<td>" . $row['occasion'] . "</td>";
		echo "<td>" . $row['color'] . "</td>";
		echo "<td>" . $row['size'] . "</td>";
		echo "<td>" . $row['price']."</td>";
		echo "<td>" . $row['quantity']."</td>";
		echo "<form action='flo_info.php' method='post'>
		      <td> <input type='hidden' name = 'fname' value='".$row['fname']."'> </td>
			  <td> <input type='hidden' name = 'fsize' value='".$row['size']."'> </td>
			  <td> <input type='submit' value='Modify'></td>
			  </form>";
		echo "</tr>";
	 }
	 mysql_close($con);
?>
	 
        			</tr>
        		</table>
				
              </div>
            	
        <div class="footer-container">
            <div class="left">
                <p>Any questions? Let us help you.  Call us: <strong>+65 9861 5555</strong>   &copy; Copyright Flowers Singapore</p>
            </div>
        </div>
    </div>
</footer>
    		</div>
        </div>
	
    </body>